﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Car C1 = new Car("小猫");
            Test1(C1);
            Test2(C1);
            Console.WriteLine();
            Dog D1 = new Dog("小狗");
            Test1(D1);
            Test3(D1);
            Console.WriteLine();
            Duck D2 = new Duck("小鸭");
            Test1(D2);
            Test3(D2);
            Console.WriteLine();
            Monkey M1 = new Monkey("小猴");
            Test1(M1);
            Test2(M1);
            Test3(M1);
        }
        static void Test1(Animal a)
        {
            a.Eat();
        }
        static void Test2(IClimb c)
        {
            c.Climb();
        }
        static void Test3(ISwim s)
        {
            s.Swim();
        }
    }
}
